package GUI;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.*;

/**
 *
 * @author Daniel Mossiossian & René van Straaten
 */
public class IntegerCheck extends PlainDocument
{

    @Override
   public void insertString(int offset, String s, AttributeSet attributeSet) throws BadLocationException
    {
      try{
             Integer.parseInt(s);
         }
         catch(Exception ex)   //only allow integer values
         {
            Toolkit.getDefaultToolkit().beep(); //macht ein DßT
            //System.out.println("Keine Zahl!");
            return ;
         }
      super.insertString(offset,s, attributeSet);
    }
}